package com.mybatis.plus.join.column;


import com.mybatis.plus.join.ColumnData;
import lombok.Data;

/**
 * mysql now()函数
 *
 * @author by zhaojin
 * @since 2021/9/24 13:05
 */
@Data
public class NowColumn implements Column{

    private String asName;

    @Override
    public String selectColumn() {
        if (asName == null || "".equals(asName.trim())) {
            return "NOW()";
        }
        return "NOW() AS " + asName;
    }

    @Override
    public void fillData(ColumnData join) {

    }

    @Override
    public void setAsName(String asName) {

    }
}
